package com.itboye.textileexpes.repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.textileexpes.interfaces.IGetYanZhengMa;
import com.itboye.textileexpes.json.ByJsonRequest.Builder;
import com.itboye.textileexpres.base.BaseErrorListener;
import com.itboye.textileexpres.base.BaseNetRepository;
import com.itboye.textileexpres.base.BaseSuccessReqListener;

public class YanzhengmaRespository extends BaseNetRepository implements
		IGetYanZhengMa<String> {

	public static String getYZM = "By_SecurityCode_send";
	String api = "101";

	public YanzhengmaRespository(ICompleteListener listener) {
		super(listener);
	}

	@Override
	public void getVerificationCode(String phoneNumber, String country,
			String codeType) {
		String apiVer = api;
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("country", country);
		params.put("mobile", phoneNumber);
		params.put("code_type", codeType);// 1: 注册 2: 更新密码 3: 新绑定手机号 5: 登录

		// 目前最简化调用
		// START
		(new Builder<String>())
				.setTypeVerParamsAndReturnClass(getYZM, apiVer, params,
						String.class)
				.requestListener(
						new BaseSuccessReqListener<String>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void add(String model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(String model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(String model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(String model) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<String> query(String model) {
		// TODO Auto-generated method stub
		return null;
	}

}
